<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<html>
<head>
<base href="<%=basePath%>">
<title>注册页面</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link rel="stylesheet" type="text/css" href="${base}/css/bootstrap.css">
<link href="${base}/css/font-awesome.css?v=4.4.0" rel="stylesheet">
<!-- Sweet Alert -->
<link href="${base}/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
<link href="${base}/css/login.css" rel="stylesheet">
<link href="${base}/css/animate.css" rel="stylesheet">

<script type="text/javascript" src="${base}/js/jquery-3.1.0.js"></script>
<script type="text/javascript" src="${base}/js/bootstrap.js"></script>
<script src="${base}/js/content.js?v=1.0.0"></script>
<!-- Sweet alert -->
<script src="${base}/js/plugins/sweetalert/sweetalert.min.js"></script>
</head>

<body class="signin" style=' background:url("${ pageContext.request.contextPath }/img/login-background.jpg") no-repeat center fixed;'>
	<div class="container">
		 <div class="signinpanel">
        <div class="row">
            <div class="col-sm-7">
                <div class="signin-info">
                    <div class="logopanel m-b">
                        <h1>[ IDEAL ]</h1>
                    </div>
                    <div class="m-b"></div>
                    <h4>欢迎使用 <strong>理想集团项目管理系统</strong></h4>
                    <ul class="m-b">
                        <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i>项目管理系统有如下优势：</li>
                        <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i>有利于项目进度控制</li>
                        <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i>方便管理</li>
                        <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i></li>
                        <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i></li>
                        
                    </ul>
                    <strong>还没有账号？ <a href="${pageContext.request.contextPath }/regist.jsp">立即注册&raquo;</a></strong>
                </div>
            </div>
            <div class="col-sm-5">
                <form method="post" id="loginForm">
                    <h4 class="no-margins">登录：</h4>
                    <p class="m-t-md">登录到项目管理系统</p>
                    <input type="text" class="form-control uname" placeholder="用户名" name="userName"/>
                    <input type="password" class="form-control pword m-b" placeholder="密码" name="password" />
                    <a href="">忘记密码了？</a>
                    
                    <input type="button"  id="regBut" class="btn btn-success btn-block" value="登陆" />
                </form>
            </div>
        </div>
        <div class="signup-footer">
            <div class="pull-left">
                &copy; 2015 All Rights Reserved.
            </div>
        </div>
    </div>
	</div>
</body>
<script type="text/javascript">
	
	
	$("#regBut").click(function(){
		
		 
		 
		 $.post("${pageContext.request.contextPath }/user/login",$('#loginForm').serialize(),function(data){
			 
			 if(data == 1){
					alert("账号或密码错误，请重新输入~");
				}else if(data == 2){
					 window.location.href='${pageContext.request.contextPath }/index.jsp';
				}else{
					
					 window.location.href=data["path"];
					
				}
			
			 
				
		},"json");
		
		
	
	});
</script>
</html>


